/*
 * @Date: 2023-10-19 14:32:29
 * @LastEditors: lyx
 * @LastEditTime: 2023-10-26 08:46:33
 * @FilePath: \sup-mini-app\src\services\login\index.ts
 * @Description:
 */
import SupRequest from "@/utils/api";

export function getOpenId(code) {
  return SupRequest({
    url: `/weapp/openId/getOpenIdFromWx/${code}`,
    method: "GET",
  });
}

export function getPhoneNumber(code) {
  return SupRequest({
    url: `/weapp/getPhoneNumber/${code}`,
    method: "GET",
  });
}

export function getOpenIdByWx(code, phone) {
  return SupRequest({
    url: `/weapp/openId/getOpenIdFromWx/${code}`,
    method: "POST",
    data: {
      phone,
    },
  });
}
